-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Fix unit tests, improve debuggability #3126
🐛 Fix unit tests, improve debuggability #3126
Conversation
f6f0b9e
to
d9fd3b1
Compare
for _, pSvcAccount := range pSvcAccounts { | ||
pSvcAccountNames = append(pSvcAccountNames, pSvcAccount.Name) | ||
} | ||
log.V(5).Info(fmt.Sprintf("Reconcile ProviderServiceAccounts: %v", strings.Join(pSvcAccountNames, ","))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just printing the ProviderServiceAccounts, this should make it easier to catch race conditions where there might not be any ProviderServiceAccounts
guestClient, err := tracker.GetClient(ctx, client.ObjectKeyFromObject(intCtx.Cluster)) | ||
Expect(err).ToNot(HaveOccurred()) | ||
// Note: Create a Service informer, so the test later doesn't fail if this doesn't work. | ||
Expect(guestClient.List(ctx, &corev1.ServiceList{}, client.InNamespace(metav1.NamespaceDefault))).To(Succeed()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saw some errors in the logs. Not sure if the test failures are due to envtest not coming up (probalby not, but shouldn't hurt to have this explicit check here)
deleteTestResource(ctx, intCtx.Client, pSvcAccount) | ||
deleteTestResource(ctx, intCtx.Client, intCtx.VSphereCluster) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some explicit cleanup. Deleting a namespace in testenv doesn't lead to all object in the namespace being deleted (there is no kube-controller-manager)
@@ -60,7 +62,15 @@ import ( | |||
) | |||
|
|||
func init() { | |||
// Set log level 5 as default for testing (default for prod is 2). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log level 5 gives us more verbose logs of our controllers, but also a lot of useful logs from CR around Reconciles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
lint fixes
LGTM label has been added. Git tree hash: e1af9ed6dade9a60dfe6d28b8eddeca975285451
|
Signed-off-by: Stefan Büringer [email protected]
d9fd3b1
to
612740d
Compare
/lgtm /hold if @fabriziopandini wants to take a look too |
LGTM label has been added. Git tree hash: 6aa47c6886b812015b6d39c47cb8858c65f69e52
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrischdi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel Happy to follow-up if necessary (want new data :)) |
What this PR does / why we need it:
This PR should:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #